#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Events used in backtesting

class Event:
    pass

class MarketData(Event):
    __slots__ = ['event_type', 'instrument', 'datetime', 'open', 'high', 'low', 'close', 'volume']
    def __init__(self, event_type, instrument, datetime, open, high, low, close, volume):
        self.event_type = event_type
        self.instrument = instrument
        self.datetime = datetime
        self.open = open
        self.high = high
        self.low = low
        self.close = close
        self.volume = volume
    
    def __str__(self):
        md_str = f"{self.event_type} event at {self.datetime} | instrument: {self.instrument}"
        return md_str

class Bar(MarketData):
    pass


class Tick(MarketData):
    pass


class Signal(Event):
    pass


# generated from Portfolio class
class Order(Event):
    pass


class Trade(Event):
    pass


if __name__ == '__main__':
    md = MarketData('MarketData', 'rb2105', '2020-01-07 09:00:00', 3875, 3878, 3875, 3877, 10000)
    print(md)